<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>显示后端传来的jsonfy格式数据</title>
</head>
<body>
<h2>显示后端传来的dict格式数据</h2>
{% for data in dict_data.data %}
    name:{{ data.name }} - {{ data }}<br>
{% endfor %}

<h2>json_str格式</h2>
{{ json_data }}
<pre><code id="json"></code></pre>
<script>
    let btn = document.querySelector('#json');
    let data = {name: 'tim', age: 23, grade: 3};
    btn.textContent = JSON.stringify(data, null, '  ');
</script>
</body>
</html>